package com.timoon.sample.page;

import org.apache.wicket.markup.head.CssHeaderItem;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.request.resource.CssResourceReference;

import com.googlecode.wicket.jquery.ui.Options;
import com.timoon.app.resource.css.CSSLocation;
import com.timoon.component.behavior.bootstrap.AbstractBootStrapBehavior;
import com.timoon.sample.utils.SystemConfig;
import com.timoon.webcomponent.utility.header.Header1Panel;
import com.timoon.webcomponent.utility.helpinfo.HelpInfoPanel;
import com.timoon.webcomponent.utility.navs.jd.JdNavPanel;

/**
 *<p>功能:head、foot组件</p>
 *<p>中部可被继承</p>
 *<p>Copyright:Copyright(c)2013</p>
 *<p>Company:sky</p>
 *@author 付乐天
 *@version 1.0 */

public class BaseHeaderFootorPage extends WebPage {
	
	protected PageParameters pageParameters;

	public BaseHeaderFootorPage(PageParameters pageParameters) {
		
		//引用bootstrap
		this.add(new AbstractBootStrapBehavior("#ddddddd", "click", new Options()));
		
		this.pageParameters=pageParameters;
		
		renderPanel();
	}

	protected void renderPanel() {
		// TODO Auto-generated method stub
		this.renderHelpInfo();
		
		this.renderHeader();
		
		this.renderNav();
	}

	private void renderHelpInfo() {
		// TODO Auto-generated method stub
		add(new HelpInfoPanel("wk_help_list",HelpListPage.class));
	}
	
	private void renderHeader() {
		// TODO Auto-generated method stub
		add(new Header1Panel("wk_header"));
	}
	
	private void renderNav() {
		// TODO Auto-generated method stub

		//add(new Nav1Panel("wk_main_nav",new SystemConfig().getNav1Parameters()));
		add(new JdNavPanel("wk_main_nav", SystemConfig.getNavParameters()));
	}
	
	@Override
	public void renderHead(IHeaderResponse response) {
		// TODO Auto-generated method stub
		super.renderHead(response);
		
		response.render(CssHeaderItem.forReference(new CssResourceReference(CSSLocation.class,"web.css")));
	}
}
